Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates the dependency injection example code to make it compilable as a single standalone project. The changes move code from separate files in the dependency-injection folder into a single Program.cs file in the overview folder, remove explicit namespaces to use implicit global namespace (enabled by ImplicitUsings), and update the documentation to reference the consolidated code.
Changes:
- Consolidated
Worker,MessageWriter, andIMessageWriterclasses into a singleProgram.csfile with snippet markers - Removed the
RootNamespaceproperty from the project file to enable global namespace compilation - Removed namespace declarations from
LoggingMessageWriter.cs - Deleted the
dependency-injectionfolder and its separate source files - Updated markdown documentation to reference the consolidated code snippets
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/core/extensions/snippets/configuration/overview/dependency-injection.csproj | Removed RootNamespace property to allow implicit global namespace |
| docs/core/extensions/snippets/configuration/overview/Program.cs | Created consolidated program with all DI example classes and snippet markers |
| docs/core/extensions/snippets/configuration/overview/LoggingMessageWriter.cs | Removed namespace declaration for global namespace compilation |
| docs/core/extensions/snippets/configuration/dependency-injection/Worker.cs | Deleted - consolidated into Program.cs |
| docs/core/extensions/snippets/configuration/dependency-injection/Program.cs | Deleted - consolidated into overview/Program.cs |
| docs/core/extensions/snippets/configuration/dependency-injection/MessageWriter.cs | Deleted - consolidated into overview/Program.cs |
| docs/core/extensions/snippets/configuration/dependency-injection/IMessageWriter.cs | Deleted - consolidated into overview/Program.cs |
| docs/core/extensions/dependency-injection.md | Updated snippet references and descriptions for the consolidated code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #50694 by putting all required components into a single code file that's displayed in the snippet window.
Internal previews